﻿//-----------------------------------------------------------------------
// <copyright file="AddressManager.cs" company="FastNET Services">
//     Copyright (c) 2007-2011. All Rights Reserved.
// </copyright>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------
#region Usings
using FastNet.BusinessSystem.Managers;
using FastNet.RepositorySystem;
using SampleBusiness.Objects;
using SampleRepository.Entities;
using SampleRepository.Repositories;
#endregion

namespace SampleBusiness.Managers
{
    public class AddressManager : IdentityBusinessManager<Address, IAddressRepository, IAddressData>
    {
        #region CTor/DTor

        /// <summary>
        /// Initializes a new instance of AddressManager
        /// </summary>
        internal AddressManager()
            : base(new RepositoryFactory())
        {
        }

        #endregion

        #region Conversions

        /// <summary>
        /// Converts IAddressData to Address based on the inheriting class rules
        /// </summary>
        /// <param name="data">IAddressData to convert</param>
        /// <returns>Address Generated</returns>
        protected override Address ConvertData(IAddressData data)
        {
            return new Address(Factory, data);
        }

        #endregion
    }
}
